﻿<ResourceDictionary 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" xmlns:local="clr-namespace:Demo.Controls">
    <Style TargetType="local:DockButton">
        <Setter Property="Background">
            <Setter.Value>
                <SolidColorBrush Color="#003366" Opacity="0.6"/>
            </Setter.Value>
        </Setter>
        <Setter Property="BorderBrush" Value="#949494"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:DockButton">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="-90" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.Rotation)" Storyboard.TargetName="path" d:IsOptimized="True"/>
                                        <DoubleAnimation Duration="0" To="90" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.Rotation)" Storyboard.TargetName="path1" d:IsOptimized="True"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unchecked"/>
                                <VisualState x:Name="Indeterminate"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid x:Name="RightPanel" Visibility="Collapsed">
                            <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="6,0,0,6"/>
                            <Path x:Name="path" Data="M4,0 L8,8 L1.5155692E-08,8 z" Fill="White" Height="8" Width="8" Margin="9,4,9,0" RenderTransformOrigin="0.5,0.5" Stretch="Fill" StrokeThickness="0" UseLayoutRounding="False" HorizontalAlignment="Left" VerticalAlignment="Top" >
                                <Path.RenderTransform>
                                    <CompositeTransform Rotation="90"/>
                                </Path.RenderTransform>
                            </Path>
                        </Grid>
                        <Grid x:Name="LeftPanel">
                            <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="0,6,6,0"/>
                            <Path x:Name="path1" Data="M4,0 L8,8 L1.5155692E-08,8 z" Fill="#FFFFFFFF" Height="8" Width="8" Margin="8.333,6,11.667,0" Stretch="Fill" UseLayoutRounding="False" HorizontalAlignment="Left" VerticalAlignment="Top" RenderTransformOrigin="0.5,0.5">
                                <Path.RenderTransform>
                                    <CompositeTransform Rotation="-90"/>
                                </Path.RenderTransform>
                            </Path>
                        </Grid>
                        <TextBlock Text="{TemplateBinding Content}" Width="18" FontSize="{TemplateBinding FontSize}" Foreground="{TemplateBinding Foreground}" HorizontalAlignment="Left" TextWrapping="Wrap" Margin="6,18,0,11" LineHeight="13" LineStackingStrategy="BlockLineHeight"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>